<?php
    class lang_controller extends Controller
    {
        public function lswitch($lang = null, $redirect = null){
            setLang($lang);

            if (!empty($redirect)){
                $url = base64_decode($redirect);
            }
            else{
                $url = SYS_LOGIN_HOME;
            }
            header("Location: $url");
            die;
        }
    }